<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>std.random</title>
  <link href="./css/style.css" rel="stylesheet" type="text/css"/>
  <!-- <link href="./img/icon.png" rel="icon" type="image/png"/> -->
  <script type="text/javascript" src="./js/jquery.js"></script>
  <script type="text/javascript" src="./js/modules.js"></script>
  <script type="text/javascript" src="./js/quicksearch.js"></script>
  <script type="text/javascript" src="./js/navigation.js"></script>
  <!--<script type="text/javascript" src="./js/jquery.treeview.js"></script>-->
  <script type="text/javascript">
    var g_moduleFQN = "std.random";
  </script>
  
</head>
<body>
<div id="content">
  <h1><a href="./htmlsrc/std.random.html" class="symbol">std.random</a></h1>
  
<dl>
<dt class="decl">uint <a class="symbol _variable" name="seed" href="./htmlsrc/std.random.html#L28" kind="variable" beg="28" end="28">seed</a>; <span class="attrs">[<span class="prot">private</span>]</span> <a title="Permalink to this symbol" href="#seed" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.random.html#L28">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">uint <a class="symbol _variable" name="index" href="./htmlsrc/std.random.html#L29" kind="variable" beg="29" end="29">index</a>; <span class="attrs">[<span class="prot">private</span>]</span> <a title="Permalink to this symbol" href="#index" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.random.html#L29">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">void <a class="symbol _function" name="rand_seed" href="./htmlsrc/std.random.html#L44" kind="function" beg="44" end="48">rand_seed</a><span class="params">(uint <em>seed</em>, uint <em>index</em>)</span>; <a title="Permalink to this symbol" href="#rand_seed" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.random.html#L44">#</a></dt>
<dd class="ddef">
<div class="summary">The random number generator is seeded at program startup with a random value.
 This ensures that each program generates a different sequence of random
 numbers. To generate a repeatable sequence, use rand_seed() to start the
 sequence. seed and index start it, and each successive value increments index.
 This means that the <i>n</i>th random number of the sequence can be directly
 generated
 by passing index + <i>n</i> to rand_seed().</div>
<p class="sec_header">Note:</p>This is more random, but slower, than C's rand() function.
 To use C's rand() instead, import std.c.stdlib.</dd>
<dt class="decl">uint <a class="symbol _function" name="rand" href="./htmlsrc/std.random.html#L55" kind="function" beg="55" end="91">rand</a><span class="params">()</span>; <a title="Permalink to this symbol" href="#rand" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.random.html#L55">#</a></dt>
<dd class="ddef">
<div class="summary">Get the next random number in sequence.</div>
<p class="sec_header"><span class="red">Bugs:</span></p>shares a global single state, not multithreaded</dd>
<dt class="decl">static <a class="symbol _sctor" name="this" href="./htmlsrc/std.random.html#L93" kind="sctor" beg="93" end="118">this</a>(); <a title="Permalink to this symbol" href="#this" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.random.html#L93">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl"><a class="symbol _unittest" name="unittest" href="./htmlsrc/std.random.html#L121" kind="unittest" beg="121" end="149">unittest</a>; <a title="Permalink to this symbol" href="#unittest" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.random.html#L121">#</a></dt>
<dd class="ddef"></dd></dl>
</div>
<div id="footer">
  <p>Copyright © 1999-2008 by Digital Mars ®, All Rights Reserved.</p>
  <p>Page generated by <a href="http://code.google.com/p/dil">dil</a> on Fri Dec 26 03:40:09 2008. Rendered by <a href="http://code.google.com/p/dil/wiki/Kandil">kandil</a>.</p>
</div>
</body>
</html>